package com.neusoft.yuejian_6.model;

import com.neusoft.yuejian_6.javabean.Master;
import com.neusoft.yuejian_6.service.ContestService;
import com.neusoft.yuejian_6.service.MasterService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.neusoft.yuejian_6.base.Constant.BASE_URL;

/**
 * Created by Q on 2017/10/12.
 */

public class MasterModel {
    private Retrofit retrofit;

    public MasterModel() {
        retrofit = new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call Master() {
        MasterService masterService = retrofit.create(MasterService.class);
        return masterService.getAllMasters();
    }
    public Call<Master> getContestById(int master_id){
        MasterService masterService=retrofit.create(MasterService.class);
        return masterService.getMasterById(master_id);
    }
}
